<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>List of Products</title>
</head>
<body>
	<f:view>
		<h1> <h:outputText value="The Products"></h:outputText>  </h1>	
		<h:form>
		<h:dataTable  border="1" var="prod" value="#{productFace.products}">
			<h:column>
				<f:facet name="header">
					<h:outputText value="Id"></h:outputText>
				</f:facet>
				<h:outputText value="#{prod.code}"></h:outputText>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Name"></h:outputText>
				</f:facet>
				<h:outputText value="#{prod.name}"></h:outputText>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Number of Itens"></h:outputText>
				</f:facet>
				<h:outputText value="#{prod.numberOfItens}"></h:outputText>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Price"></h:outputText>
				</f:facet>
				<h:outputText value="#{prod.price}">
					<f:convertNumber type="currency"/>
				</h:outputText>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Actions"></h:outputText>
				</f:facet>
				<h:commandLink  value="delete">
					
				</h:commandLink>
				<h:commandLink value="/edit"></h:commandLink>
			</h:column>
		
		</h:dataTable>
		<h:commandButton value="Add Product" action="#{productFace.startAddProduct}"></h:commandButton>
		<h:commandButton value="Cancel" action="gotoFirstPage"></h:commandButton>
		</h:form>
	</f:view>
</body>
</html>